<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix='c' uri='http://java.sun.com/jstl/core_rt' %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
        "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>My Friends</title>
<link type="text/css" rel="stylesheet" href="/bob-web/CSS/1.css" />
<link type="text/css" rel="stylesheet" href="/bob-web/CSS/2.css" />
<link type="text/css" rel="stylesheet" href="/bob-web/CSS/3.css" />
<link type="text/css" rel="stylesheet" href="/bob-web/CSS/4.css" />
<link type="text/css" rel="stylesheet" href="/bob-web/CSS/5.css" />
<link type="text/css" rel="stylesheet" href="/bob-web/CSS/6.css" />
<link type="text/css" rel="stylesheet" href="/bob-web/CSS/7.css" />
<link rel="stylesheet" type="text/css" href="/bob-web/CSS/3c-lcrc-static-pp-layout.css" />
<link rel="stylesheet" type="text/css" href="/bob-web/CSS/3c-lcrc-static-pp-presentation.css" />
<link type="text/css" rel="stylesheet" href="/bob-web/CSS/SeOrtA9JbJu.css"/>
<link rel="stylesheet" type="text/css" href="/bob-web/CSS/2FEu-VTjHxG.css" />

<script src="/bob-web/CSS/jquery-1.2.2.pack.js" type="text/javascript"></script>
<link href="/bob-web/CSS/facebox.css" media="screen" rel="stylesheet" type="text/css" />
<script src="/bob-web/CSS/facebox.js" type="text/javascript"></script>

<script type="text/javascript">
    jQuery(document).ready(function($) {
      $('a[rel*=facebox]').facebox()
    })
</script>


</head>

    
<body>


    <!-- left column -->
    <div id="lh-col"><br />
      <%@ include file="/WEB-INF/jsp/leftScreen.jsp" %>
    </div>
    <!-- end of left column -->
    <!-- center column -->
    <div id="c-col" align="left" >
     <c:if test="${model.himself}">
        <h2>My Friends</h2>

     </c:if>
      <c:if test="${!model.himself}">
        <h2>Friends Of ${model.user.name} ${model.user.surname}</h2>

     </c:if>

    <c:choose>
    <c:when test="${fn:length(model.user.friends)==0}"><br />You don't have any friends in the system.<br /><br />You can search people by using Search box at right.</c:when>
    <c:otherwise>
    <table width="90%" border="0" cellpadding="5">
        <tr>
            <th align="left">
                E-Mail
            </th>
            <th align="left">
                Name
            </th>
            <th align="left">
                Surname
            </th>
            <th align="left">
                Status
            </th>
        </tr>
        <c:forEach items="${model.user.friends}" var="result">
            <tr>
                <td>
                    <a href="/bob-web/service/profilePage.htm?wantedUserId=${result.friend.userId}">${result.friend.username}</a>
                </td>
                <td>
                    <a href="/bob-web/service/profilePage.htm?wantedUserId=${result.friend.userId}">${result.friend.name}</a>
                </td>
                <td>
                    <a href="/bob-web/service/profilePage.htm?wantedUserId=${result.friend.userId}">${result.friend.surname}</a>
                </td>
                <td>
                    <c:if test="${result.approved == 1}">Approved</c:if>
                    <c:if test="${result.approved == 0}">Waiting Approval</c:if>
                </td>
            </tr>
        </c:forEach>
    </table>
    </c:otherwise>
    </c:choose>
    </div>
    <!-- end of center column -->
    <!-- right column -->
    <div id="rh-col"> <a href="/bob-web/service/homePage.htm"><img border="0" src="/bob-web/Images/logo.png" alt="BookOfBoun" width="180" height="100" /></a>
      <%@ include file="/WEB-INF/jsp/rightScreen.jsp" %>
    </div>
    <!-- end of right column -->


</body>
</html>
